﻿<ribbon:RibbonWindow x:Class="FSNCleaner.View"
                     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                     xmlns:local="clr-namespace:FSNCleaner"
                     xmlns:utils="clr-namespace:FSNCleaner.Utils"
                     xmlns:ribbon="clr-namespace:System.Windows.Controls.Ribbon;assembly=System.Windows.Controls.Ribbon"
                     xmlns:toolkit="clr-namespace:Xceed.Wpf.Toolkit"
                     DataContext="{StaticResource MyViewModel}"
                     Title="Cleaner Fate/stay night"
                     Icon="Images/Rin.ico"
                     Height="600"
                     Width="800">

    <Window.InputBindings>
        <KeyBinding Modifiers="Control"
                    Key="O"
                    Command="{Binding OpenCommand}" />
        <KeyBinding Modifiers="Control"
                    Key="S"
                    Command="{Binding SaveCommand}" />
        <KeyBinding Modifiers="Control"
                    Key="W"
                    Command="{Binding CloseCommand}" />
    </Window.InputBindings>

    <DockPanel>
        <ribbon:Ribbon x:Name="myRibbon"
                       DockPanel.Dock="Top">
            <ribbon:Ribbon.QuickAccessToolBar>
                <ribbon:RibbonQuickAccessToolBar>
                    <ribbon:RibbonButton SmallImageSource="/FSNCleaner;component/Images/Open_16x16.png"
                                         Command="{Binding OpenCommand}"
                                         ToolTip="Open a file" />
                    <ribbon:RibbonButton SmallImageSource="/FSNCleaner;component/Images/Save_16x16.png"
                                         Command="{Binding SaveCommand}"
                                         ToolTip="Save the file" />
                </ribbon:RibbonQuickAccessToolBar>
            </ribbon:Ribbon.QuickAccessToolBar>

            <ribbon:Ribbon.HelpPaneContent>
                <ribbon:RibbonButton SmallImageSource="/FSNCleaner;component/Images/Help_16x16.png"
                                     Command="{Binding HelpCommand}"
                                     ToolTip="Open Help WebPage" />
            </ribbon:Ribbon.HelpPaneContent>

            <ribbon:Ribbon.ApplicationMenu>
                <ribbon:RibbonApplicationMenu  SmallImageSource="/FSNCleaner;component/Images/Options_16x16.png">
                    <ribbon:RibbonApplicationMenuItem Header="Open"
                                                      Command="{Binding OpenCommand}"
                                                      InputGestureText="Ctrl + O"
                                                      KeyTip="O"
                                                      QuickAccessToolBarImageSource="/FSNCleaner;component/Images/Open_16x16.png" />
                    <ribbon:RibbonApplicationMenuItem Header="Save"
                                                      Command="{Binding SaveCommand}"
                                                      InputGestureText="Ctrl + S"
                                                      KeyTip="S"
                                                      QuickAccessToolBarImageSource="/FSNCleaner;component/Images/Save_16x16.png" />
                    <ribbon:RibbonApplicationMenuItem Header="Close"
                                                      Command="{Binding CloseCommand}"
                                                      InputGestureText="Ctrl + W"
                                                      KeyTip="C"
                                                      QuickAccessToolBarImageSource="/FSNCleaner;component/Images/Close_16x16.png" />

                    <ribbon:RibbonApplicationMenu.FooterPaneContent>
                        <DockPanel LastChildFill="False">
                            <ribbon:RibbonButton Label="About"
                                                 Command="{Binding AboutCommand}"
                                                 DockPanel.Dock="Right" />
                        </DockPanel>
                    </ribbon:RibbonApplicationMenu.FooterPaneContent>

                </ribbon:RibbonApplicationMenu>
            </ribbon:Ribbon.ApplicationMenu>

            <ribbon:RibbonTab Header="Home">
                <ribbon:RibbonGroup Header="File">
                    <ribbon:RibbonSplitButton Label="Clean from All"
                                              Command="{Binding CleanFileAllCommand}"
                                              CanAddToQuickAccessToolBarDirectly="False">
                        <ribbon:RibbonMenuItem Header="Clean from Word-Wrap"
                                               Command="{Binding CleanFileWrapCommand}"
                                               CanAddToQuickAccessToolBarDirectly="False" />
                        <ribbon:RibbonMenuItem Header="Clean from LR"
                                               Command="{Binding CleanFileLRCommand}"
                                               CanAddToQuickAccessToolBarDirectly="False" />
                        <ribbon:RibbonMenuItem Header="Clean from Voices"
                                               Command="{Binding CleanFileVoicesCommand}"
                                               CanAddToQuickAccessToolBarDirectly="False" />
                        <ribbon:RibbonMenuItem Header="Clean from Comment"
                                               Command="{Binding CleanFileCommentCommand}"
                                               CanAddToQuickAccessToolBarDirectly="False" />
                    </ribbon:RibbonSplitButton>

                    <ribbon:RibbonSplitButton Label="Replace Apostrophe"
                                              Command="{Binding ReplaceApostropheCommand}"
                                              CanAddToQuickAccessToolBarDirectly="False">
                        <ribbon:RibbonMenuItem Header="Replace Quotation Marks by Guillemets"
                                               Command="{Binding ReplaceDoubleQuoteCommand}"
                                               CanAddToQuickAccessToolBarDirectly="False" />
                    </ribbon:RibbonSplitButton>

                    <ribbon:RibbonSplitButton Label="Rescript File"
                                              Command="{Binding ScriptFileCommand}"
                                              CanAddToQuickAccessToolBarDirectly="False">
                        <ribbon:RibbonMenuItem Header="Add Word-Wrap"
                                               Command="{Binding AddWordWrapCommand}"
                                               CanAddToQuickAccessToolBarDirectly="False" />
                        <ribbon:RibbonMenuItem Header="Add LR"
                                               Command="{Binding AddLRCommand}"
                                               CanAddToQuickAccessToolBarDirectly="False" />
                        <ribbon:RibbonMenuItem Header="Add Blank Space"
                                               Command="{Binding AddBlankSpaceCommand}"
                                               CanAddToQuickAccessToolBarDirectly="False" />
                    </ribbon:RibbonSplitButton>
                </ribbon:RibbonGroup>

                <ribbon:RibbonGroup Header="Directory">
                    <ribbon:RibbonSplitButton Label="Clean from All"
                                              Command="{Binding CleanDirectoryAllCommand}"
                                              CanAddToQuickAccessToolBarDirectly="False">
                        <ribbon:RibbonMenuItem Header="Clean from Voices"
                                               Command="{Binding CleanDirectoryVoicesCommand}"
                                               CanAddToQuickAccessToolBarDirectly="False" />
                        <ribbon:RibbonMenuItem Header="Clean from LR"
                                               Command="{Binding CleanDirectoryLRCommand}"
                                               CanAddToQuickAccessToolBarDirectly="False" />
                    </ribbon:RibbonSplitButton>

                    <ribbon:RibbonSplitButton Label="Retranslate Pages"
                                              Command="{Binding RetranslateDirectoryCommand}"
                                              CanAddToQuickAccessToolBarDirectly="False">
                        <ribbon:RibbonMenuItem Header="Word-Count"
                                               Command="{Binding WordCountDirectoryCommand}"
                                               CanAddToQuickAccessToolBarDirectly="False" />
                    </ribbon:RibbonSplitButton>

                    <ribbon:RibbonButton Label=" Rescript Files"
                                         Command="{Binding ScriptDirectoryCommand}"
                                         CanAddToQuickAccessToolBarDirectly="False" />
                </ribbon:RibbonGroup>

                <ribbon:RibbonGroup Header="XP3">
                    <ribbon:RibbonButton Label="Repack a Directory"
                                         Command="{Binding RepackXP3Command}"
                                         CanAddToQuickAccessToolBarDirectly="False" />

                    <ribbon:RibbonComboBox Label="Encryption"
                                           SelectionBoxWidth="50">
                        <ribbon:RibbonGallery SelectedValue="{Binding RepackEncryption, Mode=TwoWay}">
                            <ribbon:RibbonGalleryCategory ItemsSource="{Binding RepackEncryption, Mode=OneTime,
                                Converter={StaticResource EnumValuesConverter}}" />
                        </ribbon:RibbonGallery>
                    </ribbon:RibbonComboBox>

                    <ribbon:RibbonCheckBox Label="Use Compression"
                                           IsChecked="{Binding IsCompressed, Mode=TwoWay}"
                                           CanAddToQuickAccessToolBarDirectly="False" />
                </ribbon:RibbonGroup>

                <ribbon:RibbonGroup Header="Encoding">
                    <ribbon:RibbonComboBox Label="Open with"
                                           SelectionBoxWidth="52">
                        <ribbon:RibbonGallery SelectedValue="{Binding OpenEncoding, Mode=TwoWay}">
                            <ribbon:RibbonGalleryCategory ItemsSource="{Binding OpenEncoding, Mode=OneTime,
                                Converter={StaticResource EnumValuesConverter}}" />
                        </ribbon:RibbonGallery>
                    </ribbon:RibbonComboBox>

                    <ribbon:RibbonComboBox Label="Save with"
                                           SelectionBoxWidth="57">
                        <ribbon:RibbonGallery SelectedValue="{Binding SaveEncoding, Mode=TwoWay}">
                            <ribbon:RibbonGalleryCategory ItemsSource="{Binding SaveEncoding, Mode=OneTime,
                                Converter={StaticResource EnumValuesConverter}}" />
                        </ribbon:RibbonGallery>
                    </ribbon:RibbonComboBox>

                    <ribbon:RibbonCheckBox Label="Realta Nua support"
                                           IsChecked="{Binding IsRealtaNua, Mode=TwoWay}"
                                           CanAddToQuickAccessToolBarDirectly="False" />
                </ribbon:RibbonGroup>
            </ribbon:RibbonTab>
        </ribbon:Ribbon>

        <StatusBar DockPanel.Dock="Bottom"
                   Background="{Binding Path=Background, ElementName=myRibbon}">
            <StatusBarItem>
                <Label Content="Current File:" />
            </StatusBarItem>
            <StatusBarItem>
                <TextBlock Text="{Binding Path=CurrentFile.NameFile, Mode=OneWay}" />
            </StatusBarItem>
        </StatusBar>

        <toolkit:BusyIndicator IsBusy="{Binding Path=IsBusy, Mode=OneWay}"
                                  BusyContent="{Binding Path=Status, Mode=OneWay}">
            <TextBox Text="{Binding Path=CurrentFile.TextString, Mode=OneWay}"
                     IsReadOnly="True"
                     AllowDrop="True"
                     HorizontalScrollBarVisibility="Auto"
                     VerticalScrollBarVisibility="Auto"
                     utils:DragOverBehavior.Command="{Binding DragOverCommand}"
                     utils:DropBehavior.Command="{Binding DropCommand}" />
        </toolkit:BusyIndicator>

    </DockPanel>
</ribbon:RibbonWindow>